﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Net;
using Zyg.Utility.Helper;

namespace Zyg.SSO.Core.Business
{
    public class Log : BusinessBase<Log, int>
    {
        public Log()
        {
        }
        #region properties
        private int id;
        private DateTime datecreated;
        private string message = string.Empty;
        private string action = string.Empty;
        private Guid accountid;
        private Guid moduleid;


        public string Message
        {
            get { return message; }
            set { if (message != value) { message = value; MarkChanged("Message"); } }
        }
        public string Action
        {
            get { return action; }
            set { if (action != value) { action = value; MarkChanged("Action"); } }
        }
        public Guid AccountId
        {
            get { return accountid; }
            set { if (accountid != value) { accountid = value; MarkChanged("AccountId"); } }
        }
        public Guid ModuleId
        {
            get { return moduleid; }
            set { if (moduleid != value) { moduleid = value; MarkChanged("ModuleId"); } }
        }

        #endregion

        #region Base overrides

        protected override Log DataSelect(int id)
        {
            return Services.DALService.SelectLog(id);
        }
        protected override void DataDelete()
        {
            Services.DALService.DeleteLog(this);
        }
        protected override void DataInsert()
        {
            Services.DALService.InsertLog(this);
        }
        protected override void DataUpdate()
        {
            Services.DALService.UpdateLog(this);
        }
        protected override void ValidationRules()
        {

        }
        #endregion
        #region Static Methods
        public static IList<Business.Log> GetAllLog()
        {
            return Services.DALService.FillLogs();
        }
        #endregion
    }
}
